package cn.com.code.generator;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableSwagger2
@MapperScan("cn.com.code.generator.dao")
@ComponentScan(basePackages = {"cn.com.code.generator","cn.com.do1.dsf"})
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
public class GeneratorApplication {

	public static void main(String[] args) {
		SpringApplication.run(GeneratorApplication.class, args);
	}

	/**
	 * 自动识别使用的数据库类型
	 * 在mapper.xml中databaseId的值就是跟这里对应，
	 * 如果没有databaseId选择则说明该sql适用所有数据库
	 */
	/*@Bean
	public DatabaseIdProvider getDatabaseIdProvider() {
		DatabaseIdProvider databaseIdProvider = new VendorDatabaseIdProvider();
		Properties properties = new Properties();
		properties.setProperty("Oracle", "oracle");
		properties.setProperty("MySQL", "mysql");
		databaseIdProvider.setProperties(properties);
		return databaseIdProvider;
	}*/
}
